from django.conf.urls import url
from django.urls import path
from api_test.api import user, VisitorRecord
from api_test.api.game import GameList
from api_test.api.helpdocument import HelpDocument
from api_test.api.locusttest import LocustTest, AddLocustCase, LocustRecordListView, \
    LocustCaseListView, DelLocustCaseView, UpdateLocustCaseView, DelLocustRecordView, CancelLocustTest
from api_test.api.plancase import AddTestPlanCase, TestPlanCaseList, UpdateTestPlanCase, DelTestPlanCase
from api_test.api.testPlan import TestPlanList, AddTestPlan, UpdateTestPlan, DelTestPlan, ExecuteTestPlan, \
    ImportPlanCase, TestPlanGlobalParameter, TestPlanReportList, AddTestPlanConfig, UpdateTestPlanConfig, \
    GetTestPlanConfig
from api_test.api.group import Group, AddGroup, UpdateNameGroup, DelGroup
from api_test.api.version import Version, AddVersion, UpdateNameVersion, DelVersion
from api_test.api.statuscode import StatusCode, AddStatusCode, UpdateStatusCode, DelStatusCode, ImportFileStatusCode
from api_test.api.host import HostTotal, AddHost, UpdateHost, DelHost
from api_test.api.datatype import DataType, AddDataType, UpdateDataType, DelDataType, \
    DataStructure, AddDataStructure, DelDataStructure, UpdateDataStructure
from api_test.api.api import ApiList, ApiInfoDetail, AddApi, UpdateApi, DelApi, UploadFile, DownloadFile, FileList, \
    DeleteFile, ImportFileApi
from api_test.api.case import CaseInfoList, AddApiCase, UpdateApiCase, DelApiCase
from api_test.api.project import ProjectList, ProjectInfo, AddProject, DelProject, UpdateProject
from api_test.api.mock import GetMockRequest, AddMockRequest, MockList, EditMockRequest, DeleteMockRequest
from api_test.api.coverage import CoverageList, CoverageEcharts


urlpatterns = [
    url(r'project/project_list', ProjectList.as_view()),
    url(r'project/project_add', AddProject.as_view()),
    url(r'project/project_update', UpdateProject.as_view()),
    url(r'project/project_del', DelProject.as_view()),
    url(r'project/project_info', ProjectInfo.as_view()),

    url(r'global/host_total', HostTotal.as_view()),
    url(r'global/host_add', AddHost.as_view()),
    url(r'global/host_update', UpdateHost.as_view()),
    url(r'global/host_del', DelHost.as_view()),

    url(r'api/group_total', Group.as_view()),
    url(r'api/group_add', AddGroup.as_view()),
    url(r'api/group_update', UpdateNameGroup.as_view()),
    url(r'api/group_del', DelGroup.as_view()),

    url(r'api/version_total', Version.as_view()),
    url(r'api/version_add', AddVersion.as_view()),
    url(r'api/version_update', UpdateNameVersion.as_view()),
    url(r'api/version_del', DelVersion.as_view()),

    url(r'api/statuscode_total', StatusCode.as_view()),
    url(r'api/statuscode_add', AddStatusCode.as_view()),
    url(r'api/statuscode_update', UpdateStatusCode.as_view()),
    url(r'api/statuscode_del', DelStatusCode.as_view()),

    url(r'global/datatype_total', DataType.as_view()),
    url(r'global/datatype_add', AddDataType.as_view()),
    url(r'global/datatype_update', UpdateDataType.as_view()),
    url(r'global/datatype_del', DelDataType.as_view()),

    url(r'global/datastructure_total', DataStructure.as_view()),
    url(r'global/datastructure_add', AddDataStructure.as_view()),
    url(r'global/datastructure_update', UpdateDataStructure.as_view()),
    url(r'global/datastructure_del', DelDataStructure.as_view()),

    url(r'api/api_list', ApiList.as_view()),
    url(r'api/api_add', AddApi.as_view()),
    url(r'api/api_update', UpdateApi.as_view()),
    url(r'api/api_del', DelApi.as_view()),
    url(r'api/api_info', ApiInfoDetail.as_view()),

    url(r'case/case_info', CaseInfoList.as_view()),
    url(r'case/case_add', AddApiCase.as_view()),
    url(r'case/case_update', UpdateApiCase.as_view()),
    url(r'case/case_del', DelApiCase.as_view()),

    url(r'user/login', user.obtain_auth_token),
    url(r'user/VisitorRecord', VisitorRecord.Record.as_view()),

    url(r'file/List', FileList.as_view()),
    url(r'file/Upload', UploadFile.as_view()),
    url(r'file/Download', DownloadFile.as_view()),
    url(r'file/Delete', DeleteFile.as_view()),
    url(r'file/api_import', ImportFileApi.as_view()),
    url(r'file/statusCode_import', ImportFileStatusCode.as_view()),

    url(r'plan/list', TestPlanList.as_view()),
    url(r'plan/add', AddTestPlan.as_view()),
    url(r'plan/edit', UpdateTestPlan.as_view()),
    url(r'plan/delete', DelTestPlan.as_view()),
    url(r'plan/execute', ExecuteTestPlan.as_view()),
    url(r'plan/params', TestPlanGlobalParameter.as_view()),
    url(r'plan/reports', TestPlanReportList.as_view()),
    #
    url(r'planConf/add', AddTestPlanConfig.as_view()),
    url(r'planConf/edit', UpdateTestPlanConfig.as_view()),
    url(r'planConf/list', GetTestPlanConfig.as_view()),

    #
    url(r'planCase/add', AddTestPlanCase.as_view()),
    url(r'planCase/list', TestPlanCaseList.as_view()),
    url(r'planCase/edit', UpdateTestPlanCase.as_view()),
    url(r'planCase/import', ImportPlanCase.as_view()),
    url(r'planCase/delete', DelTestPlanCase.as_view()),
    #
    url(r'game/list', GameList.as_view()),

    url(r'helpDocument', HelpDocument.as_view()),
    path('mock/<path:address>', GetMockRequest.as_view()),
    url(r'mocker/add', AddMockRequest.as_view()),
    url(r'mocker/list', MockList.as_view()),
    url(r'mocker/edit', EditMockRequest.as_view()),
    url(r'mocker/delete', DeleteMockRequest.as_view()),

    url(r'coverage/list', CoverageList.as_view()),
    url(r'coverage/echarts', CoverageEcharts.as_view()),
    url(r'locust/run', LocustTest.as_view()),
    url(r'locustCase/add', AddLocustCase.as_view()),
    url(r'locustRecord/list', LocustRecordListView.as_view()),
    url(r'locustCase/list', LocustCaseListView.as_view()),
    url(r'locustCase/edit', UpdateLocustCaseView.as_view()),
    url(r'locustCase/delete', DelLocustCaseView.as_view()),
    url(r'locustRecord/delete', DelLocustRecordView.as_view()),
    url(r'locust/cancel', CancelLocustTest.as_view())



]
